package com.ydd.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("用户实体类")
public class SysUser implements Serializable {

    @TableId(type = IdType.ASSIGN_ID) // mp自动填充id
    private String id;

    @ApiModelProperty("登录名")
    @JsonProperty("login_name")
    private String loginName;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("登录ip")
    private String loginIp;

    @ApiModelProperty("最后登录时间")
    private LocalDateTime loginDate;

    @TableField(fill = FieldFill.INSERT)  // mp自动填充
    @ApiModelProperty("创建时间")
    @JsonProperty("create_date")
    private LocalDateTime createDate;

    @TableField(fill = FieldFill.INSERT_UPDATE)  // mp自动填充
    @JsonProperty("update_date")
    @ApiModelProperty("修改时间")
    private LocalDateTime updateDate;

    @ApiModelProperty("删除标记 0：正常，1：删除") // 0：正常，1：删除 逻辑删除
    @TableLogic
    private String delFlag;

    @ApiModelProperty("角色id")
    private String roleId;

    @ApiModelProperty("状态 1：正常，0：禁用")  //1：正常，0：禁用
    private Integer status;

    @ApiModelProperty("默认数据")
    @JsonProperty("default_data")
    private String defaultData;


}
